package cn.com.huzo.model.entities.master;

import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 产品目录实体类
 *
 * @author 吴旭
 */
public class ProductCatalogueEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 3012271483655963865L;
    private Long CatalogueId;
    private Long ParentId;
    private String OrderNo;
    private String CatalogueName;
    private Short NodeType;
    private String Description;
    /**
     * 上级结点名
     */
    private String ParentName;
    /**
     * 在树的位置
     */
    private long Level;
    /**
     * 子节点个数
     */
    private long NumChildren;

    public Long getCatalogueId() {
        return CatalogueId;
    }

    public Long getParentId() {
        return ParentId;
    }

    public String getOrderNo() {
        return OrderNo;
    }

    public String getCatalogueName() {
        return CatalogueName;
    }

    public Short getNodeType() {
        return NodeType;
    }

    public String getDescription() {
        return Description;
    }

    public String getParentName() {
        return ParentName;
    }

    public long getLevel() {
        return Level;
    }

    public long getNumChildren() {
        return NumChildren;
    }

    public void setCatalogueId(Long CatalogueId) {
        this.CatalogueId = CatalogueId;
    }

    public void setParentId(Long ParentId) {
        this.ParentId = ParentId;
    }

    public void setOrderNo(String OrderNo) {
        this.OrderNo = OrderNo;
    }

    public void setCatalogueName(String CatalogueName) {
        this.CatalogueName = CatalogueName;
    }

    public void setNodeType(Short NodeType) {
        this.NodeType = NodeType;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public void setParentName(String ParentName) {
        this.ParentName = ParentName;
    }

    public void setLevel(long Level) {
        this.Level = Level;
    }

    public void setNumChildren(long NumChildren) {
        this.NumChildren = NumChildren;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ProductCatalogueEntity)) {
            return false;
        }

        final ProductCatalogueEntity that = (ProductCatalogueEntity) o;

        return new EqualsBuilder()
            .append(this.getCatalogueId(), that.getCatalogueId())
            .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getCatalogueId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
